<template>
        <el-dialog 
        :close-on-click-model="clickClose"
        :title="title" 
        :visible.sync="visible">
        <slot></slot>
      <div slot="footer">
        
                <el-button @click="visible=false">取消</el-button>
                <el-button type="primary" 
                :loading="confirmLoading" 
                @click="$emit('confirm')"
                  >确定</el-button>
               
    
            
             </div>
        </el-dialog>
</template>

<script>
    export default {
        name:'MyDialog',
        data() {
            return {
                /**
                 * 是否显示
                 */
            visible:false,
            /**
             * 提交Loading
             */
            confirmLoading:false,
            }
        },
        methods:{
            /**
             * 显示
             */
            show(){
               this.visible=true
            },
            /**
             * 隐藏
             */
            hide(){
                this.visible=false
            },
            /**
             * 开始loading
             */
            start(){
                this.confirmLoading=false;
            },
              /**
             * 结束loading
             */
            stop(){
                this.confirmLoading=false;
            }
        },
        props:{
            /**
             * 标题
             */
            title:String,
            /**
             * 点击遮罩关闭
             */
            clickClose:Boolean,
    }
    }
</script>

<style lang="scss" scoped>

</style>